import env
import mcrud
import api
import amg2plot
import snowflake

env.load("../.env")
db = mcrud.new_env()
amg2plot.init_table_line(db)

data = [
    {"year": '1991', "value": 3},
    {"year": '1992', "value": 4},
    {"year": '1993', "value": 3.5},
    {"year": '1994', "value": 5},
    {"year": '1995', "value": 4.9},
    {"year": '1996', "value": 6},
    {"year": '1997', "value": 7},
    {"year": '1998', "value": 9},
    {"year": '1999', "value": 13},
]

for item in data:
    new_item = item.copy()
    new_item["id"] = snowflake.idstr()
    db.add_by_dict(
        amg2plot.table_line,
        new_item,
    )

data =db.get_all(amg2plot.table_line)
print(data)